#include <linux/jiffies.h>

unsigned long __msecs_to_jiffies(const int m)
{
    unsigned long ret;

	/*
	 * Negative value, means infinite timeout:
	 */
	if (m < 0)
    {
        ret = MAX_JIFFY_OFFSET;
    }
	else
    {
        ret = _msecs_to_jiffies(m);
    }	

	return ret;
}

unsigned long _msecs_to_jiffies(const unsigned int m)
{
    unsigned long ret = m;

    ret *= HZ;
    ret /= 1000;

    if (!ret && m)
    {
        ret = 1;
    }

    return ret;
}
